#ifndef HEAP_H
#define HEAP_H

#include "queuestrategy.h"
#include "utils.h"

using std::vector;

class Heap : public QueueStrategy
{
private:
	//Edge *edgeArray;
	vector <Edge> edgeVector;
	int tail;
	int size;

public:
	Heap(int size = 0);
	//~Heap() { free(edgeArray); }
	~Heap() { }
	
	void insert(Edge edge);
	Edge deleteMin();
	
	void sort(vector<Edge> &edgeVector);
	
private:
	void downIterative(int start);

	void up(int left, int right);
	void down(int pos);
	
	void heapify();
};

#endif
